create table hh_stu
(
   id number(11) primary key, name varchar2(32), age number (2),birthday date
)

select * from hh_stu;
delete from hh_stu where id = 1;


insert into hh_stu values(4,hejuan,20,null);

truncate table hh_stu;

create sequence hh_stu_seq;


create or replace trigger hh_stu_trigger
	before insert or update
	on hh_stu
	for each row
declare
	tid number;
begin
	if updating then
		:new.id := :old.id;--可以用来防止修改id
	elsif inserting then--此处不是elseif
		select seq1.NEXTVAL into tid from dual;
		:new.id := tid;
	end if;
end hh_stu_trigger;

insert into hh_stu (name) values('daxiaojianghu');


select s.* ,rownum r from hh_stu s where rownum<5;--要给hh_stu表取别名才能使用
select * from (select s.* ,rownum r from hh_stu s where rownum<5) where r>2;